#include<iostream>
#include<map>
using namespace std;
int main()
{
	int t;	cin >> t;
	while (t--) {
		map<string, int>mp;
		int n;
		cin >> n;
		int k = 1;
		while (n) {
			bool flag = 1;
			int z = 0;
			bool f2 = 0, f3 = 0, f4 = 0, f5 = 0;
			for (int i = 1; i <= k; i++){
				cout << k;
				if ((n - 2) >= 0 && !f2 &&n) {
					cout << "s2" << " ";
					n -= 2;
					f2 = 1;
				}
				else if ((n - 6) >= 0 &&!f3&&n) {	
					cout << "p6" << " ";
					n -= 6;
					f3 = 1;
				}
				else if ((n - 10) >= 0 &&!f4&&n) {
					cout << "d10" << " ";
					n -= 10;
					f4 = 1;
				}
				else if ((n - 14) >= 0&&!f5&&n) {
					cout << "f14" << " ";
					n -= 14;
					f5 = 1;
				}	
				else {
					cout << "s" << n << " ";
					flag = 0;
					break;
				}
			}
			if (!flag) {
				break;
			}
			else {
				k++;
			}
		}
		cout << endl;
	}

	return 0;
}